CC            = gcc
CFLAGS        = -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT 
INCPATH       =-I. -I/usr/include -I/usr/include/xmms2 -I/usr/include/curl -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -I. -I.
LINK          = gcc
LFLAGS        = 
LIBS          = $(SUBLIBS) -lpthread -lglib-2.0 -lxmmsclient -lcurl -lxmmsclient-glib 
TAR           = tar -cf
COMPRESS      = gzip -9f
COPY          = cp -f
COPY_FILE     = $(COPY)
COPY_DIR      = $(COPY) -r
INSTALL_FILE  = install -m 644 -p
INSTALL_DIR   = $(COPY_DIR)
INSTALL_PROGRAM = install -m 755 -p
DEL_FILE      = rm -f
SYMLINK       = ln -sf
DEL_DIR       = rmdir
MOVE          = mv -f
CHK_DIR_EXISTS= test -d
MKDIR         = mkdir -p

####### Output directory

OBJECTS_DIR   = ./build

####### Files

SOURCES       = audioscrobbler.c \
		md5.c \
		main.c
OBJECTS       = audioscrobbler.o \
		md5.o \
		main.o
DIST          = 
DESTDIR       = 
TARGET        = xmms2-audioscrobbler

first: all
####### Implicit rules

.SUFFIXES: .o .c

.c.o:
	$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"

####### Build rules

all: Makefile $(TARGET)

$(TARGET):  md5.h $(OBJECTS)  
	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)

dist: 
	@$(CHK_DIR_EXISTS) .tmp/xmms2-audioscrobbler1.0.0 || $(MKDIR) .tmp/xmms2-audioscrobbler1.0.0 
	$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/xmms2-audioscrobbler1.0.0/ && $(COPY_FILE) --parents audioscrobbler.c .tmp/xmms2-audioscrobbler1.0.0/ && (cd `dirname .tmp/xmms2-audioscrobbler1.0.0` && $(TAR) xmms2-audioscrobbler1.0.0.tar xmms2-audioscrobbler1.0.0 && $(COMPRESS) xmms2-audioscrobbler1.0.0.tar) && $(MOVE) `dirname .tmp/xmms2-audioscrobbler1.0.0`/xmms2-audioscrobbler1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/xmms2-audioscrobbler1.0.0


clean:compiler_clean 
	-$(DEL_FILE) $(OBJECTS)
	-$(DEL_FILE) *~ core *.core


####### Sub-libraries

distclean: clean
	-$(DEL_FILE) $(TARGET) 
	-$(DEL_FILE) Makefile

####### Compile

audioscrobbler.o: audioscrobbler.c 
	$(CC) -c $(CFLAGS) $(INCPATH) -o audioscrobbler.o audioscrobbler.c
md5.o: md5.c
	$(CC) -c $(CFLAGS) $(INCPATH) -o md5.o md5.c
main.o: main.c
	$(CC) -c $(CFLAGS) $(INCPATH) -o main.o main.c

####### Install

install:   FORCE

uninstall:   FORCE

FORCE:

